package com.jf.ext.interceptor;

import com.jf.aop.Interceptor;
import com.jf.aop.Invocation;
import com.jf.core.Controller;

/**
 * Accept POST method only.
 */
public class POST implements Interceptor {
	public void intercept(Invocation inv) {
		Controller controller = inv.getController();
		if ("POST".equalsIgnoreCase(controller.getRequest().getMethod().toUpperCase()))
			inv.invoke();
		else
			controller.renderError(404);
	}
}
